PangoRectangle char_rect;
gchar *entry_text;
gint index, x_layout, y_layout;
- GdkSurface *surface;
- gint x_surface, y_surface;
GtkAllocation allocation;
textw = get_text (atk_text);
gtk_widget_get_allocation (GTK_WIDGET (textw), &allocation);
- surface = gtk_widget_get_surface (GTK_WIDGET (textw));
- gdk_surface_get_origin (surface, &x_surface, &y_surface);
-
- *x = x_surface + allocation.x + x_layout + char_rect.x;
- *y = y_surface + allocation.y + y_layout + char_rect.y;
+ *x = allocation.x + x_layout + char_rect.x;
+ *y = allocation.y + y_layout + char_rect.y;
*width = char_rect.width;
*height = char_rect.height;
-
- if (coords == ATK_XY_WINDOW)
- {
- surface = gdk_surface_get_toplevel (surface);
- gdk_surface_get_origin (surface, &x_surface, &y_surface);
-
- *x -= x_surface;
- *y -= y_surface;
- }
}
static gint
GtkText *textw;
gchar *text;
gint index, x_layout, y_layout;
- gint x_surface, y_surface;
gint x_local, y_local;
- GdkSurface *surface;
glong offset;
textw = get_text (atk_text);
gtk_text_get_layout_offsets (textw, &x_layout, &y_layout);
- surface = gtk_widget_get_surface (GTK_WIDGET (textw));
- gdk_surface_get_origin (surface, &x_surface, &y_surface);
+ x_local = x - x_layout;
+ y_local = y - y_layout;
- x_local = x - x_layout - x_surface;
- y_local = y - y_layout - y_surface;
-
- if (coords == ATK_XY_WINDOW)
- {
- surface = gdk_surface_get_toplevel (surface);
- gdk_surface_get_origin (surface, &x_surface, &y_surface);
-
- x_local += x_surface;
- y_local += y_surface;
- }
if (!pango_layout_xy_to_index (gtk_text_get_layout (textw),
x_local * PANGO_SCALE,
y_local * PANGO_SCALE,
PangoRectangle char_rect;
const gchar *label_text;
gint index, x_layout, y_layout;
- GdkSurface *surface;
- gint x_surface, y_surface;
widget = gtk_accessible_get_widget (GTK_ACCESSIBLE (text));
if (widget == NULL)
pango_layout_index_to_pos (gtk_label_get_layout (label), index, &char_rect);
pango_extents_to_pixels (&char_rect, NULL);
- surface = gtk_widget_get_surface (widget);
- gdk_surface_get_origin (surface, &x_surface, &y_surface);
-
- *x = x_surface + x_layout + char_rect.x;
- *y = y_surface + y_layout + char_rect.y;
+ *x = x_layout + char_rect.x;
+ *y = y_layout + char_rect.y;
*width = char_rect.width;
*height = char_rect.height;
-
- if (coords == ATK_XY_WINDOW)
- {
- surface = gdk_surface_get_toplevel (surface);
- gdk_surface_get_origin (surface, &x_surface, &y_surface);
-
- *x -= x_surface;
- *y -= y_surface;
- }
}
static gint
GtkLabel *label;
const gchar *text;
gint index, x_layout, y_layout;
- gint x_surface, y_surface;
gint x_local, y_local;
- GdkSurface *surface;
widget = gtk_accessible_get_widget (GTK_ACCESSIBLE (atk_text));
if (widget == NULL)
gtk_label_get_layout_offsets (label, &x_layout, &y_layout);
- surface = gtk_widget_get_surface (widget);
- gdk_surface_get_origin (surface, &x_surface, &y_surface);
-
- x_local = x - x_layout - x_surface;
- y_local = y - y_layout - y_surface;
-
- if (coords == ATK_XY_WINDOW)
- {
- surface = gdk_surface_get_toplevel (surface);
- gdk_surface_get_origin (surface, &x_surface, &y_surface);
-
- x_local += x_surface;
- y_local += y_surface;
- }
+ x_local = x - x_layout;
+ y_local = y - y_layout;
if (!pango_layout_xy_to_index (gtk_label_get_layout (label),
x_local * PANGO_SCALE,
PangoRectangle char_rect;
gchar *entry_text;
gint index, x_layout, y_layout;
- GdkSurface *surface;
- gint x_surface, y_surface;
GtkAllocation allocation;
widget = gtk_accessible_get_widget (GTK_ACCESSIBLE (text));
gtk_widget_get_allocation (widget, &allocation);
- surface = gtk_widget_get_surface (widget);
- gdk_surface_get_origin (surface, &x_surface, &y_surface);
-
- *x = x_surface + allocation.x + x_layout + char_rect.x;
- *y = y_surface + allocation.y + y_layout + char_rect.y;
+ *x = allocation.x + x_layout + char_rect.x;
+ *y = allocation.y + y_layout + char_rect.y;
*width = char_rect.width;
*height = char_rect.height;
-
- if (coords == ATK_XY_WINDOW)
- {
- surface = gdk_surface_get_toplevel (surface);
- gdk_surface_get_origin (surface, &x_surface, &y_surface);
-
- *x -= x_surface;
- *y -= y_surface;
- }
}
static gint
GtkText *entry;
gchar *text;
gint index, x_layout, y_layout;
- gint x_surface, y_surface;
gint x_local, y_local;
- GdkSurface *surface;
glong offset;
widget = gtk_accessible_get_widget (GTK_ACCESSIBLE (atk_text));
gtk_text_get_layout_offsets (entry, &x_layout, &y_layout);
- surface = gtk_widget_get_surface (widget);
- gdk_surface_get_origin (surface, &x_surface, &y_surface);
+ x_local = x - x_layout;
+ y_local = y - y_layout;
- x_local = x - x_layout - x_surface;
- y_local = y - y_layout - y_surface;
-
- if (coords == ATK_XY_WINDOW)
- {
- surface = gdk_surface_get_toplevel (surface);
- gdk_surface_get_origin (surface, &x_surface, &y_surface);
-
- x_local += x_surface;
- y_local += y_surface;
- }
if (!pango_layout_xy_to_index (gtk_text_get_layout (entry),
x_local * PANGO_SCALE,
y_local * PANGO_SCALE,
surface = gtk_widget_get_surface (widget);
gdk_surface_get_origin (surface, x_surface, y_surface);
- surface = gdk_surface_get_toplevel (gtk_widget_get_surface (widget));
gdk_surface_get_origin (surface, x_toplevel, y_toplevel);
if (GTK_IS_TREE_VIEW (widget))
{
GtkTextView *view;
GtkTextIter iter;
- gint x_widget, y_widget, x_surface, y_surface, buff_x, buff_y;
+ gint buff_x, buff_y;
GtkWidget *widget;
- GdkSurface *surface;
GdkRectangle rect;
widget = gtk_accessible_get_widget (GTK_ACCESSIBLE (text));
if (widget == NULL)
return -1;
- view = GTK_TEXT_VIEW (widget);
- surface = gtk_widget_get_surface (widget);
- gdk_surface_get_origin (surface, &x_widget, &y_widget);
-
- if (coords == ATK_XY_SCREEN)
- {
- x = x - x_widget;
- y = y - y_widget;
- }
- else if (coords == ATK_XY_WINDOW)
- {
- surface = gdk_surface_get_toplevel (surface);
- gdk_surface_get_origin (surface, &x_surface, &y_surface);
-
- x = x - x_widget + x_surface;
- y = y - y_widget + y_surface;
- }
- else
+ if (coords != ATK_XY_WINDOW)
return -1;
+ view = GTK_TEXT_VIEW (widget);
+
gtk_text_view_window_to_buffer_coords (view, GTK_TEXT_WINDOW_WIDGET,
x, y, &buff_x, &buff_y);
gtk_text_view_get_visible_rect (view, &rect);
GtkTextIter iter;
GtkWidget *widget;
GdkRectangle rectangle;
- GdkSurface *surface;
- gint x_widget, y_widget, x_surface, y_surface;
*x = 0;
*y = 0;
gtk_text_buffer_get_iter_at_offset (buffer, &iter, offset);
gtk_text_view_get_iter_location (view, &iter, &rectangle);
- surface = gtk_widget_get_surface (widget);
- if (surface == NULL)
- return;
-
- gdk_surface_get_origin (surface, &x_widget, &y_widget);
-
*height = rectangle.height;
*width = rectangle.width;
gtk_text_view_buffer_to_surface_coords (view, GTK_TEXT_WINDOW_WIDGET,
rectangle.x, rectangle.y, x, y);
- if (coords == ATK_XY_WINDOW)
- {
- surface = gdk_surface_get_toplevel (surface);
- gdk_surface_get_origin (surface, &x_surface, &y_surface);
- *x += x_widget - x_surface;
- *y += y_widget - y_surface;
- }
- else if (coords == ATK_XY_SCREEN)
- {
- *x += x_widget;
- *y += y_widget;
- }
- else
+ if (coords != ATK_XY_WINDOW)
{
*x = 0;
*y = 0;
0, 0,
&w_x, &w_y);
- if (coord_type != ATK_XY_WINDOW)
- {
- GdkSurface *surface;
- gint x_toplevel, y_toplevel;
-
- surface = gdk_surface_get_toplevel (gtk_widget_get_surface (widget));
- gdk_surface_get_origin (surface, &x_toplevel, &y_toplevel);
-
- w_x += x_toplevel;
- w_y += y_toplevel;
- }
-
*width = cell_rect.width;
*height = cell_rect.height;
if (is_cell_showing (tree_view, &cell_rect))
gint *height,
AtkCoordType coord_type)
{
- GdkSurface *surface;
- gint x_surface, y_surface;
- gint x_toplevel, y_toplevel;
GtkWidget *widget;
GtkAllocation allocation;
{
*x = allocation.x;
*y = allocation.y;
- surface = gtk_widget_get_surface (gtk_widget_get_parent (widget));
}
else
{
*x = 0;
*y = 0;
- surface = gtk_widget_get_surface (widget);
- }
- gdk_surface_get_origin (surface, &x_surface, &y_surface);
- *x += x_surface;
- *y += y_surface;
-
- if (coord_type == ATK_XY_WINDOW)
- {
- surface = gdk_surface_get_toplevel (gtk_widget_get_surface (widget));
- gdk_surface_get_origin (surface, &x_toplevel, &y_toplevel);
-
- *x -= x_toplevel;
- *y -= y_toplevel;
}
}
gint height,
AtkCoordType coord_type)
{
- return FALSE;
+ return FALSE;
}
static gboolean
gint y,
AtkCoordType coord_type)
{
- return FALSE;
+ return FALSE;
}
static gboolean
gint width,
gint height)
{
- return FALSE;
+ return FALSE;
}
static void